<?php
namespace App\Http\Resources\Trade\Supply;

use App\Http\Resources\ResourceCollection;

class RejectListResource extends ResourceCollection
{

    /**
     * Transform the resource into an array.
     *
     * @param \Illuminate\Http\Request $request            
     * @return array
     */
    public function toArray($request)
    {
        return $this->collection->map(function ($item, $key) {
            return RejectDetailResource::makeDataDecode($item);
        })
            ->groupBy('supply_id')
            ->toArray();
    }
}
